A Type-theoretic Reconstruction of the Visitor Pattern

نویسندگان

  • Peter Buchlovsky
  • Hayo Thielecke
چکیده

In object-oriented languages, the Visitor pattern can be used to traverse tree-like data structures: a visitor object contains some operations, and the data structure objects allow themselves to be traversed by accepting visitors. In the polymorphic lambda calculus (System F), tree-like data structures can be encoded as polymorphic higher-order functions. In this paper, we reconstruct the Visitor pattern from the polymorphic encoding by way of generics in Java. We sketch how the quantified types in the polymorphic encoding can guide reasoning about visitors in general.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Unmanned aerial vehicle field sampling and antenna pattern reconstruction using Bayesian compressed sensing

Antenna 3D pattern measurement can be a tedious and time consuming task even for antennas with manageable sizes inside anechoic chambers. Performing onsite measurements by scanning the whole 4π [sr] solid angle around the antenna under test (AUT) is more complicated. In this paper, with the aim of minimum duration of flight, a test scenario using unmanned aerial vehicles (UAV) is proposed. A pr...

متن کامل

A cone theoretic Krein-Milman theorem in semitopological cones

In this paper, a Krein-Milman  type theorem in $T_0$ semitopological cone is proved,  in general. In fact, it is shown that in any locally convex $T_0$ semitopological cone, every convex compact saturated subset is the compact saturated convex hull of its extreme points, which improves the results of Larrecq.

متن کامل

Random Pattern Vertically Oriented, Partial Thickness Buccinator Myomucosal Flap for Intraoral Reconstruction: A Report of Two Cases

Introduction: Reconstruction of the oral cavity witha flap design containing the buccal mucosa and buccinator muscle but excluding the facial artery and vein is the topic of these case reports. Case Reports: This article uses random pattern vertically oriented partial thickness buccinator myomucosal flap for intraoral reconstruction in two cases. The first was for lining the mandibular anterior...

متن کامل

Optimized ‎P‎ricing Decisions In a Multi-Level Supply Chain With Various Power and Channel Structures‎: ‎A Game-Theoretic Approach‎

This article studies the optimization of pricing decisions in a supply chain with different channels under different power structure. Three different channel will be considered here; these include: the decentralized, the semi-integrated, and the integrated channel. There are two types of power balance structures for both the decentralized and the semi-integrated channels. The first type is a le...

متن کامل

Evolution of Object Behavior using

CompositeEquipment abstract void visit (Visitor v) void net() {....} void discount() {....} Card void visit (Visitor v) { v.atCard(this); } void visit (Visitor v) Cabinet { v.atCabinet(this); for (int i=0; i<numparts; i++) parts[i].visit(v); } Fig. 6. Composite Equipment Pattern erations to perform during composite-object traversal. A composite is a structural pattern that represents a wholepar...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 155  شماره 

صفحات  -

تاریخ انتشار 2006